package newcommerce.events
{
	
	/**
	* MediaEvent groups all events related to medias in the playqueue or standalone.
	*/
	public class MediaEvent extends FlexibleEvent
	{
		/**
		* TRACK_DATA_READY is fired when a track is ready to be used (all information contained by it is there
		*/
		public static const TRACK_DATA_READY:String = "track_data_ready";
		
		/**
		* RELEASE_DATA_READY is fired when a release contains all necessary data within
		*/
		public static const RELEASE_DATA_READY:String = "release_data_ready";
		
		public static const VIDEO_DATA_READY:String = "video_data_ready";
		
		/**
		* TRACK_STARTED_PLAYING is fired when a media has started playing (data is being received on the stream)
		*/
		public static const MEDIA_STARTED_PLAYING:String = "media_started_playing";
		
		/**
		* TRACK_FINISHED_PLAYING is fired when the media has done playing
		*/
		public static const MEDIA_FINISHED_PLAYING:String = "media_finished_playing";
		
		/**
		* MEDIA_IS_TRACK is fired by the MediaSwitch to tell us the media currently playing is a track
		*/
		public static const MEDIA_IS_TRACK:String = "media_is_track";
		
		/**
		* MEDIA_IS_VIDEO is fired by the MediaSwitch to tell us the media currently playing is a video
		*/
		public static const MEDIA_IS_VIDEO:String = "media_is_video";
		
		public static const MEDIA_IS_READY:String = "media_is_ready";
		
		/**
		* MEDIA_QUEUE_MODIFIED is fired when the queue in the playQueue is modified
		*/
		public static const MEDIA_QUEUE_MODIFIED:String = "media_queue_modified";
		
		/**
		* MEDIA_ADDED is fired when a media is added to the playqeuue
		*/
		public static const MEDIA_ADDED:String = "media_added";

		/**
		* MEDIA_REMOVED is fired when a media is removed from the play queue
		*/
		public static const MEDIA_REMOVED:String = "media_removed";
		
		/**
		* MEDIA_SEEK is fired by the playBar when a media seek is requested
		*/
		public static const MEDIA_SEEK:String = "media_seek";
		
		/**
		* MEDIA_PLAY is fired when the playbar is asked to play a media
		*/
		public static const MEDIA_PLAY:String = "media_play";
		
		/**
		* MEDIA_PAUSE is fired when the pause button is pressed
		*/
		public static const MEDIA_PAUSE:String = "media_pause";
		
		/**
		* MEDIA_TIME is fired when the media time is updated
		*/
		public static const MEDIA_TIME:String = "media_time";
		
		/**
		* MEDIA_RATED is fired by the Rating control when someone rates a media
		*/
		public static const MEDIA_RATED:String = "media_rated";
		
		/**
		* VOLUME is fired when the volume is changed
		*/
		public static const VOLUME:String = "volume";
		
		/**
		* MUTE is fired when somebody pressed on the mute/unmute button
		*/
		public static const MUTE:String = "mute";
		
		public static const NEXT_MEDIA:String = "next_media";
		
		public static const PREVIOUS_MEDIA:String = "previous_media";
		
		public static const MEDIA_VOTED:String = "media_voted";
		
		/**
		* PLAY_MEDIA_BY_INDEX is fired by the media container when somebody clicks on a specific media
		*/
		public static const PLAY_MEDIA_BY_INDEX:String = "play_media_by_index";
		
		public static const MEDIA_DURATION:String = "media_duration";
		
		public static const MEDIA_LOAD_PROGRESS:String = "media_load_progress";
		
		public static const MEDIA_LINKTO_VIDEO:String = "media_linkto_video";
		
		public static const MEDIA_LINKTO_ARTIST:String = "media_linkto_artist";
		
		public static const INVALID_MEDIA:String = "invalid_media";

		/**
		* Constructor of MediaEvent
		* @param	type type of the event: MUTE, PLAY_MEDIA_BY_INDEX, RELEASE_DATA_READY, MEDIA_ADDED, TRACK_DATA_READY ...
		* @param	args an object containing the properties of this events 
		*/
		public function MediaEvent(type:String, args:Object)
		{
			super(type, args);
		}
		
		/**
		* Rather useless function that returns the type of event
		* @return type of event (object type)
		*/
		public override function toString():String
		{
			return "ca.newcommerce.events.MediaEvent";
		}
	}
}